﻿using System;

namespace Unis.Framework.ORM.Attributes
{
    [AttributeUsage(AttributeTargets.Property)]
    public class ReferenceObjectAttribute : Attribute
    {
        // Fields
        private string foreignKey;
        private string primaryKey;
        private Type referenceType;

        // Methods
        public ReferenceObjectAttribute()
        {
        }

        public ReferenceObjectAttribute(Type referenceType, string primaryKey, string foreignKey)
        {
            this.referenceType = referenceType;
            this.primaryKey = primaryKey;
            this.foreignKey = foreignKey;
        }

        // Properties
        public string ForeignKey
        {
            get
            {
                return this.foreignKey;
            }
            set
            {
                this.foreignKey = value;
            }
        }

        public string PrimaryKey
        {
            get
            {
                return this.primaryKey;
            }
            set
            {
                this.primaryKey = value;
            }
        }

        public Type ReferenceType
        {
            get
            {
                return this.referenceType;
            }
            set
            {
                this.referenceType = value;
            }
        }
    }
}
